<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title></title>
</head>
<body>
    <form action="" method="post">
        <table border="1" cellspacing="0" cellpadding="10px" id='tableId'>
            <tr>
				<th></th>
				<th>姓名</th>
				<th>性别</th>
				<th>年龄</th>
				<th>家庭住址</th>
			</tr>
            <tr>
                <td><input type="checkbox" name="p" id="" value="1"></td>
                <td>方建国</td>
                <td>男</td>
                <td>36</td>
                <td>北京朝阳区</td>
            </tr>
            <tr>
                <td><input type="checkbox" name="p" id="" value="2"></td>
                <td>赵铁柱</td>
                <td>男</td>
                <td>42</td>
                <td>东北辽宁</td>
            </tr>
            <tr>
                <td><input type="checkbox" name="p" id="" value="3"></td>
                <td>赵秀芬</td>
                <td name="nv">女</td>
                <td>37</td>
                <td>浙江杭州</td>
            </tr>
            <tr>
                <td><input type="checkbox" name="p" id="" value="4"></td>
                <td>段芳莲</td>
                <td name="nv">女</td>
                <td>30</td>
                <td>四川攀枝花</td>
            </tr>
        </table>
        <td><input type="checkbox" name="" id="qx" value="" onclick="All();" /></td>全选
        <td><input type="checkbox" name="" id="qxnv" value="" onclick="women();" /></td>全选女
        <td><input type="checkbox" name="" id="qxnan" value="" onclick="man();" /></td>全选男

    </form>
</body>
<script type="text/javascript">
 
    function All(){
			var tableo = document.getElementById('tableId');
			var allput = tableo.getElementsByTagName('input');
			var allvalue = document.getElementById('qx');
			for(var i=0;i<allput.length;i++){
				allput[i].checked = allvalue.checked;
			}
		}
 </script>
</html>